home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ToolSort_
- #define _ToolSort_
-
- #include <stdio.h>
-
- #define NIL 0L
-
- #define No_Error 0
- #define End_Error 1 /* Selection must end with a carriage return. */
- #define Type_Error 2 /* No selection of type 'TEXT' in scarp. */
- #define Memory_Error 4 /* Not enough memory. */
- #define Nil_Hand_Error 8 /* Nil Handle Error. */
- #define Empty_Error 16 /* No selection, scrap empty. */
- #define Sys_Error 32 /* A system error, probably relating to the filing system. */
- #define Scrap_Error 64 /* Error writing desk scrap. */
- #define TEScrap_Error 128 /* Error writing writing TEScrap. */
-
- #define alertID 2
-
- typedef struct SelLineRec
- {
- int noLines;
- Handle *lines; /* array of Handles of lines of text */
- } SelLine;
-
- typedef struct SelRec
- {
- long length; /* length of selection */
- Handle sel; /* handle to selection */
- } SelRec;
-
- typedef Handle Text;
-
-
- /******************* Function Prototypes ******************************/
-
- int Bubble(void *elem, int big, int num, int (*comp)(), int (*set)() );
- int BuildLines( SelRec validSel, SelLine * selLine );
- int Comp( Handle *e1, Handle* e2 );
- void GetValidSel(SelRec *validSel);
- int SelToText( SelLine sortSel, Text *txt );
- int Set( Handle *e1, Handle* e2 );
- int ShellSort(void *elem, int big, int num, int (*comp)(), int (*set)() );
- int Swap( Handle *e1, Handle* e2 );
- int UpdateSel( Handle txt );
-
- void main(void);
-
- #endif